package com.pgytesting.secondhandcar.controller.mcpuser;

import com.pgytesting.secondhandcar.service.McpUserInfoService;
import com.pgytesting.secondhandcar.vo.ResponseMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : frosty0804@gmail.com
 * @version : v1.0
 * @projectName : secondhandcar
 * @className : UserQueryController
 * @description : TODO(用户数据查询控制层)
 * @date : 2019/8/29 10:45
 */
@Slf4j
@RestController
@RequestMapping("/user/query")
public class UserQueryController {

    @Autowired
    McpUserInfoService mcpUserInfoService;


    @RequestMapping(value = "/getUserInf", method = RequestMethod.GET)
    public ResponseMessage getUserInf() {
        try {
            return mcpUserInfoService.queryAll();
        } catch (Exception e) {
            log.error("服务异常", e);
            return ResponseMessage.errorResponse("服务异常");
        }

    }
}
